package com.study.controller;

import com.study.service.MsgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @desc:
 * @author: panxiyi
 * @date: 2023/5/3 10:04 下午
 */

@RestController
@RequestMapping("/msg")
public class MsgController {


    @Autowired
    private MsgService msgService;

    // 生成验证码
    @RequestMapping(value = "/code_gen", method = RequestMethod.GET)
    public String generateCode(String tele) {
        return msgService.genCode(tele);
    }

    // 校验验证码
    @RequestMapping(value = "/code_check", method = RequestMethod.POST)
    public Boolean checkCode(String tele, String code) {
        return msgService.checkCode(tele, code);
    }
}
